package state.pattern.demo;

/**
 * Created by DELL
 * Date: 2019/10/11.
 * Time: 10:09
 */
public class TV {
    private RemoteControl state;

    public RemoteControl getState() {
        return state;
    }

    public void setState(RemoteControl state) {
        this.state = state;
    }

    public TV(RemoteControl state) {
        this.state = state;
    }
    // this 指当前类的对象
    public void preesButton(){
        state.pressSwith(this);
    }
}
